/*
 * Copyright (c) 2009 Origami Frontiers Pte Ltd
 */
package com.rill.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import com.rill.dao.RoleDAO;
import com.rill.pojo.po.RoleInfo;

/**
 * @author rill
 * @date 2009-12-12
 */
public class ServiceUtil {
    public static ApplicationContext appContext = new FileSystemXmlApplicationContext(new String[]{"classpath:spring-base.xml", "classpath:spring-core.xml"});
    //public static ApplicationContext appContext = new ClassPathXmlApplicationContext("classpath:spring-base.xml");
    public static RoleDAO roleDAO = (RoleDAO) appContext.getBean("roleDAO");

    public static void main(String[] args){
    	/*roleDAO.testRole("test aop");
    	RoleInfo roleInfo = new RoleInfo();
    	roleInfo.setName("root");
    	roleInfo.setParentId(1);
    	roleInfo.setLevel(0);
    	roleInfo.setParentPath("1");
    	roleDAO.addRole(roleInfo);*/
    	RoleInfo roleInfo = roleDAO.getRoleById(2);
    	roleDAO.updateRole(roleInfo);
    }
    
}
